#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
char* my_strstr(const char* str1, const char* str2)
{
	assert(str1 && str2);
	const char* p1 = NULL;
	const char* p2 = NULL;
	const char* cur = str1;
	if (*str2 == '\0')
		return (char*)str1;
	while (*cur)
	{
		p1 = cur;
		p2 = str2;
		while (*p1 != '\0' && *p2 != '\0' && *p1 == *p2)
		{
			p1++;
			p2++;
		}
		if (*p2 == '\0')
		{
			return (char*)cur;
		}
		cur++;
	}
	return NULL;
}
int main()
{
	char arr1[] = "asdfgghhjkl";
	char arr2[] = "ghhj";
	char* ret = my_strstr(arr1, arr2);
	if (ret == NULL)
	{
		printf("canont find\n");
	}
	else
	{
		printf("%s\n", ret);
	}
	return 0;
}